package server.model.entity;

import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * 创建人:    xvzhe
 * 创建时间:
 * 修改时间:
 * 版本:      v1.0
 */
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@DynamicInsert
@DynamicUpdate
@ApiModel("用户地址")
public class UserSite {
    @Id
    @GeneratedValue(generator = "UuidProduce")
    @GenericGenerator(name = "UuidProduce", strategy = "server.tool.idProduce.UuidProduce")
    private String id;

    @Column
    @NotNull
    private String site;

    @Column
    @NotNull
    private String mobile;

    @Column
    @NotNull
    private String people;

    private String userId;

    @Column(columnDefinition = "int default 0")
    private Boolean isDefault;

    @Column(columnDefinition = "bit(1) default 1")
    private Boolean status;

    private Boolean pick;
}
